package com.flw.eslab.web.util;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Component;
@Component("ipRecordUtils")
public class IPRecordUtils {
	public String getIpAddr(HttpServletRequest request) {
		String ip = request.getHeader("x-forwarded-for");
		if (ip == null || ip.length() == 0) {
			ip = request.getRemoteAddr();
		}
		return ip;
	}
}
